<table class="table table-striped goods_list_table   table-bordered">
    <thead>
        <tr>
            <th class="opth100">供应商联系人</th>
        	<th class="opth100">采购单名称</th>
            <th class="opth100">商品名</th>
        	<th class="opth100">报价数量</th>
        	<th class="opth100">实际采用数量</th>
        	<th class="opth100">报价价格</th>
        	<th class="opth100">送货时间</th>
        	<th class="opth70">是否批次送货</th>
            <th class="opth70">是否处理</th>
            <th class="opth70">是否确认</th>
            <th class="opth70">是否有效</th>
            <th class="opth70">交易状态</th>
            <th class="opth70">管理员操作</th>
            <th class="opth70">操作时间</th>
            <th class="opth70">操作</th>
        </tr>
    </thead>
    <tbody id="tbodylist">
        <volist name="_datalist['lists']" id="g">
            <tr>
                <td>{$g['linkname']}</td>
            	<td>{$g['purchaseame']}</td>
                <td>{$g['goodsname']}</td>
                <td>{$g['offer_number']}</td>
            	<td>{$g['actual_number']}</td>
                <td>{$g['offer_price']}</td>
                <td>{$g['sendtime']}</td>
                <td>{$g['isbatch']==1?'是':'否'}</td>
                <td>{$g['ishandle']==1?'是':'否'}</td>
                <td>{$g['iscomfirm']==1?'采购':'<span style="color:red;">未采购</span>'}</td>
                <td>{$arr2[$g['isactive']]}</td>
                <td>{$arr[$g['check']]}</td>
                <td>{$g['user_name']}</td>
                <td>{$g['createtime']}</td>
                <td>
                <if condition="$g['check'] eq 2">
                        <a href="javascript:;"onclick="_es_openDilogLarge('{:U('validate',array(offerid=>$g['offerid']))}')" class="btn btn-default btn-primary">发票验证</a>
                 <elseif condition="$g['check'] eq 3" />   
                 <span >等收发票</span>    
                <elseif condition="$g['check'] eq 4" />   
                 <span style="color:red;">交易失败</span> 
                <elseif condition="$g['check'] eq 1" />   
                 <span style="color:#5cb85c;">交易成功</span> 
                <elseif condition="$g['check'] eq 5" />
                  <a  onclick="verification('{$g['offerid']}',3)" class="btn btn-default btn-primary">交易完成</a>
                </if>
                </td>
            </tr>
        </volist>

    </tbody>
</table>
<notempty name="_datalist['lists']">
  <div class="page_list_ops dataTables_paginate paging_bootstrap pagination">
    {$_datalist['page_html']}
 </div>	

</notempty>

    <script>

   var url ="{:U('/Offer/invoice')}";
        function verification(offerid,state) {
            $.ajax({
                'url': url,
                'data': {offerid:offerid,state:state},
                'dataType': 'json',
                'type': 'get',
                success: function (data) {
              
                        art.dialog({title:'温馨提示',content: data.msg, ok: function () {this.close();return false;},okval:'确定'});
                          setTimeout(function(){
                             var win=    art.dialog.opener;
                                        win._reload_currentpage_datalist('load_tb_div');
                                        art.dialog.close();
                             },1000); 
                        _load_html_byurl("{:U('offerList')}", "load_tb_div");
                }, error: function () {
                    

                }, complete: function () {

                }
            });


        }



    </script>


